tests: Unify some tmpdir code, add ability for C to use libtest.sh
authorColin Walters <walters@verbum.org>
Wed, 2 Mar 2016 15:05:08 +0000 (10:05 -0500)
committerColin Walters <walters@verbum.org>
Thu, 3 Mar 2016 23:03:32 +0000 (18:03 -0500)
commitebd03709764da853483f12a31a7e0c8c4c8f8d9f
treea5521ed1dbdb940e94856f3f04fecaabeeb21af2
parent12db46e5af64a0d30aed2daa0224d36230adaac4
tests: Unify some tmpdir code, add ability for C to use libtest.sh

I want to be able to easily test the C API on actual data in an OSTree
repo.  The shell `libtest.sh` has code to generate it.  Bridge the two
worlds by introducing a little `libostreetest` library which has a C
API which spawns a shell that runs things in `libtest.sh`.

Yes, this is about as beautiful as it sounds, which is to say, it's
not.  But it works!

Note while we were here, I realized we were actually now creating
*two* tmpdirs per test in `make check` because the tap driver was
already doing that.  Unify it so we know the C code can rely on it.
Makefile-tests.am
buildutil/tap-test
tests/libostreetest.c [new file with mode: 0644]
tests/libostreetest.h [new file with mode: 0644]
tests/libtest.sh
tests/test-basic-c.c [new file with mode: 0644]